Usb device communication apparatus, systems, and methods

ABSTRACT

Some embodiments include methods and apparatus to decode a functional request embedded in a portion of a standard device request, and execute the functional request by a universal serial bus (USB) device. The standard device request can include a Get_Descriptor request. Other embodiments are described.

PRIORITY APPLICATION

This application is a continuation of U.S. application Ser. No.13/616,858, filed Sep. 14, 2012, which is a continuation of U.S.application Ser. No. 12/957,081, filed Nov. 30, 2010, now issued as U.S.Pat. No. 8,335,865, which is a continuation of U.S. application Ser. No.11/765,287, filed Jun. 19, 2007, now issued as U.S. Pat. No. 7,853,725,all of which are incorporated herein by reference in their entirety.

TECHNICAL FIELD

Various embodiments described herein relate to apparatus, systems, andmethods associated with Universal Serial Bus (USB) communications,including communicating with devices in a restricted host environment.

BACKGROUND

USB devices are utilized as part of a number of systems including butnot limited to printers, monitors, keyboards, mice, memory devices suchas flash memory devices or “thumb drives,” cellular phones, digitalcameras, digital recorders, and other peripherals. Computers aredesigned to utilize various operating systems such as Microsoft'sWindows XP™ and Windows Vista™ and Apple's Mac OS X™.

USB devices generally operate using a standard protocol or interface,such as the interface set by the USB Implementers Forum, Inc. The USBImplementers Forum, Inc. is a non-profit corporation founded by a groupof companies that developed a Universal Serial Bus specification. Formore information regarding the USB specification, the reader isencouraged to consult the document “Universal Serial Bus Specification”Revision 2.0, published by the USB Implementers Forum in 2000, and laterversions (hereinafter the “USB Specification”).

USB devices may communicate with computers utilizing an operating systemwithout the need to install additional drivers or software onto thecomputer provided the instructions or requests used by the USB deviceare supported by the drivers resident on the host. Administrators maywish to maintain control over a user's modifications to a computer.Thus, operating systems allow administrators to limit the ability ofusers to install or update drivers or modify the operation of thecomputer. The environment the user encounters in this case is oftenreferred to as a restricted host environment.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a block diagram of a system according to an embodiment ofthe invention.

FIG. 2 shows a block diagram of a system according to an embodiment ofthe invention.

FIG. 3 shows a block diagram of communication flow according to anembodiment of the invention.

FIG. 4 shows a flow diagram of a method of enabling a security operationaccording to an embodiment of the invention.

FIG. 5 shows a flow diagram of a method of logging in to a locked USBdevice according to an embodiment of the invention.

FIG. 6 shows a flow diagram of a method of receiving and executing abuffer operation on a USB device according to an embodiment of theinvention.

FIG. 7 shows a flow diagram of a method of receiving and executing asecurity operation for a USB device according to an embodiment of theinvention.

FIG. 8 shows a flow diagram of a method of receiving and modifying aparameter of a USB device according to an embodiment of the invention.

FIG. 9 shows a flow diagram of a method of receiving and executing afunctional request at a USB device according to an embodiment of theinvention.

DETAILED DESCRIPTION

FIG. 1 shows a block diagram of a system 100 according to an embodimentof the invention. The system may comprise a host 110 and a USB device150. The host 110 may comprise a memory 112, a host controller 114, anda USB hub 116. The host 110 may interact with the USB device 150 throughthe host controller 114 via a USB hub 116 and bus 140. The host 110 maystore software, drivers and an operating system in memory 112. Thememory 112 may comprise volatile and nonvolatile memory, including flashmemory, and can be accessed by the host controller 114 to utilize thesoftware, drivers and operating system.

The USB device 150 may comprise a USB bus interface 165 to receivecontrol endpoint standard device requests with embedded functionalsub-requests. The functional sub-requests can be embedded in a portionof the control endpoint standard device request. The USB device 150 mayalso comprise a logic controller 160 to implement the functionalsub-request. The functional sub-request may comprise a buffer operation(e.g., buffer reset, buffer copy, and fetching the buffer structure); ora security operation (e.g., login/logout, enabling/disabling security,changing the password, reading/writing key data, and media recovery). Inaddition, functional requests may be specific functional requests to USBdevice 150, such as power off, power on, record, and others as specifiedby the USB device developer.

The USB bus interface 165 may operate to receive data in a secondportion of the control endpoint standard device request. If thefunctional sub-request is a write request, for example, logic controller160 may operate to receive the data and store the data in a location inthe memory 170.

Memory 170 may be partitioned to include a secured memory 172 and anunsecured memory 174. The functional sub-request may be a securityrequest, in which case the logic controller 160 may operate to lock thesecured memory 172 of the USB device 150. The logic controller 160 mayoperate to unlock the secured memory 172 of the USB device 150 when thefunctional sub-request is a unlock request. In addition the logiccontroller 160 may operate to erase the memory 170 or a portion thereof,when the functional sub-request is an erase request.

The unsecured memory 174 may be used to store client software. Theclient software, in turn, may be transferred by a user to the host 110and stored in the memory 112. The client software may be executed by thehost controller 112 to encode a functional sub-request forming a firstportion of a control endpoint standard device request. The clientsoftware may be executable code that may run in a restricted hostenvironment. In a restricted host environment, the user may not bepermitted to install drivers onto host 110. The inability to installdrivers on a host 110 may limit the functionality of USB device 150.However, even when the host 110 is operating in a restricted hostenvironment, the operating system may allow the installation of clientsoftware in memory 112 either from unsecured memory 174, the internet,or other media.

USB device 150 may also comprise an operative unit 155, such as printerhardware, a camera, or other hardware. The operative unit 155 may becontrolled by logic controller 160 to perform an action, such asprinting, taking a picture, and scanning a document.

The USB bus interface 165 may receive data in a second portion of acontrol endpoint standard device request, wherein the functionalsub-request comprises a write request. The write request may cause thememory 170 to receive the data and to store the data in the memory 170.The USB device 150 may also have the logic controller 160 lock the USBdevice 150 when the functional sub-request comprises a lock request. TheUSB device 150 may also have logic controller 160 unlock the USB device150 when the functional sub-request is a unlock request. The USB device150 may also have the logic controller 160 erase the memory 170 when thefunctional sub-request comprises an erase request.

FIG. 2 shows a block diagram of a system 200 according to an embodimentof the invention. The system 200 comprises a host 210 and a USB device250. Host 210 may comprise a memory 212, a host controller 214, and aUSB hub 216. USB hub 216 may be attached via an electrical wire, bus orwirelessly via connection 280, to USB device 250. USB device 250 maycomprise one or more of a keyboard 235, a mouse 240, an imaging sensor245, a memory device 252, a transceiver/antenna 255, a display 260, acamcorder or camera 265, a printer 270, a compact disc (CD)/digitalvideo disc (DVD) drive 275, or any number of other devices that may beattached to a host 210 via a USB connection 280 to a USB hub 216.

FIG. 3 shows a block diagram of communication flow according to anembodiment of the invention. The system 300 comprises a host 310 and aUSB device 350. Host 310 may comprise client software 311, USB systemsoftware 313, and a Host USB interface 315. The Host USB interface 315may comprise a Host Controller 314 and a Host Serial Interface Engine316. USB device 350 may comprise a function layer 355, a USB logicaldevice layer 360, and a USB bus interface 365. USB logical device layer360 may comprise a control endpoint zero 362. USB bus interface 365 maycomprise a USB serial interface engine 367.

Information flows for the system 300 includes representations of truedata flows in bus 340, 342, 344, 346, and 348. Data flows illustrated infunctional pipes 372 and message pipe or control pipe 374 (to bedesignated as control pipe 374 for the balance of this document) areabstract representations of data flows. While both functional pipes 372and control pipe 374 are not hardwired pipes, and data between host 310and USB device 350 actually flows through bus 340, for ease ofunderstanding the operation of various embodiments, data flow throughcontrol pipe 374 will be characterized as device requests. The controlpipe 374 normally comes into existence once a USB device 350 is poweredon, in order to provide access to the USB device's 350 configuration,status, and control information.

Each USB device 350 may support one or more functional pipes 372 throughwhich the host 310 may communicate with the USB device 350. USB devices,such as USB device 350 generally supports a specially designated controlpipe 374 at control endpoint zero 362 to which the control pipe 374 maybe attached. Associated with the control pipe 374 at control endpointzero 362 may be the information used to describe the USB device 350. Acontrol pipe 374, also known as a message pipe, is defined in the USBSpecification as “A bi-directional pipe that transfers data using arequest/data/status paradigm. The data has an imposed structure thatallows requests to be reliably identified and communicated.”

Data processed through control pipe 374 may have a set configuration andbe limited to 8 bytes. Control pipe 374 is normally used to send andreceive USB device requests. USB device requests are normally eightbytes in length and follow the format set in table 1.

TABLE 1 Offset Field Size (Bytes) Value 0 bmRequest Type 1 Request Type1 bmRequest 1 Request 2 wValue 2 Value 4 wIndex 2 Index or Offset 6wLength 2 Count

There are currently eleven standard device request codes set out, andtwo codes that may be set in the future. The eleven codes are:Get_Status, Clear_Feature, Set_Feature, Set_Address, Get_Descriptor,Set_Descriptor, Get_Configuration, Set_Configuration, Get_Interface,Set_Interface, and Synch_Frame.

A Clear_Feature is used to clear or disable a specific feature of USBdevice 150, 250, 350. A Get_Interface request may be used to retrieve aselected alternate setting for a specified interface from the USB device150, 250, 350. A Set_Interface request may be used to set a specifiedinterface for the USB device 150, 250, 350. A Get_Status request may beused to retrieve the status of the USB device 150, 250, 350. Set_Addressmay be used to set the USB device 150, 250, 350 address for future USBdevice 150, 250, 350 access. Set_Configuration may be used to set theUSB device configuration. Get_Configuration may cause the USB device150, 250, 350 to provide the current configuration value for the USBdevice 150, 250, 350. Set_Descriptor may be used to update existingdescriptors, or to add new descriptors to USB device 150, 250, 350.Set_Feature is a request that can be used to set or enable a specificfeature of the USB device 150, 250, 350. Synch_Frame is a request usedto set and then report an endpoint's synchronization frame. For furtherinformation regarding the specifics of the standard device request codesand their use the reader is encouraged to consult the USB Specification.

When a Get_Descriptor request is made, USB device 150, 250, 350 returnsa specific descriptor to the host 110, 210, 310. The specific descriptormay include standard information such as vendor identification, deviceclass, and power management capability. In addition, specificdescriptors may include device, configuration, interface, and endpointdescriptions, as well as other configuration-related information aboutthe device.

Get_Descriptor requests are formatted as shown in table 2 below:

TABLE 2 bmRequest Type bmRequest wValue wIndex wLength Data 10000000BGet_Descriptor Descriptor Zero or Descriptor Descriptor Type andLanguage Length Descriptor Index ID

Get_Descriptor requests support a limited number of descriptor type anddescriptor index requests in the wValue field portion of the request.Table 3 lists the descriptor types specified in the USB Specification.

TABLE 3 Descriptor Types Value Device 1 Configuration 2 String 3Interface 4 Endpoint 5 Device Qualifier 6 Other Speed Configuration 7Interface Power 8

Thus, only a limited number of descriptor codes are prescribed for usein the wValue field of a Get_Descriptor request. None of these comprisea functional request. However, by utilizing a value that is notprescribed, the wValue field can be used to encode a functional request.For example, if a user desires to reset a buffer, the executable filemay have the host controller 114 of FIG. 1 send a Get_Descriptor requestwith wValue with a high byte of 0x03 and a low byte of 0x10, as shown inTable 4. Such a request is not recognized by the USB Specification.

TABLE 4 bmRequest Type bmRequest wValue wIndex wLength 1 byte 1 byte 2byte 2 byte 2 byte 10000000B 00000110B 0x03 0x10 0x00 0x00 0x00 0x00

Other requests not recognized by the USB Specification may also be madein this manner. For example, referring to FIG. 1, USB device 150 (e.g.,a mass storage device). USB device 150 may be accessed by host 110 usingmass storage protocols to read/write data from or to the USB device 150.In special cases, a USB device 150 may provide extra functions, such aslocking the secured memory 172 of USB device 150 or unlocking thesecured memory 172 of USB device 150.

Host 110 may operate in a restricted mode as set by the administratorsor operations system of Host 110. If Host 110 is in a restricted mode,the host controller 114 may be unable to access vendor-specific requestswithout installing additional drivers in memory 112. The USB device 150may have an executable file stored in the unsecured memory 174 partitionof memory 170. By transferring the executable file to memory 112, hostcontroller 114 may run the executable file.

Logic controller 160 may receive the Get_Descriptor request from host110. Logic controller 160 may decode the Get_Descriptor request and afunctional command encoded into wValue. Referring to FIG. 3, it can beseen that the USB system software 313 transmits the Get_Descriptorrequest to the control endpoint zero 362 via control pipe 374. USBlogical device layer 360 may decode the Get_Descriptor command anddetermine that the wValue portion of the Get_Descriptor request is not adescriptor request but a functional request. USB logical device layer360 may then execute the functional request encoded into wValue.

FIG. 4 shows a flow diagram of a method of enabling a security operationaccording to an embodiment of the invention. FIG. 4 illustrates how auser operating an embodiment of the invention may enable the securityfunction using a password “lexar12345”.

Activity 410 may include decoding a reset buffer request from the firstportion of a control endpoint standard device request, and resetting thebuffer. For example, the first portion of the control endpoint standarddevice request may be the wValue portion of a Get_Descriptor request.

Activity 420, comprising several sub-activities, may involve writing thepassword to a specific location, such as in the memory 170 of USB device150 of FIG. 1. To send the password to the USB device 150, 250, 350 thehost 110, 210, 310 (see FIGS. 1, 2, 3) may encode data into a secondportion of the control endpoint standard device request. The secondportion of the control endpoint standard device request may comprise thewIndex portion of a Get_Descriptor request, for example.

The first portion of the Get_Descriptor request, wValue, may have awrite request encoded with a memory location. To write the password,“lexar12345” into the memory 170 of USB device 150 of FIG. 1, host 110may need to submit six separate Get_Descriptor requests, 422, 424, 426,428, 430 and 432.

Activity 422 may comprise a Get_Descriptor request with a write requestencoded into wValue for location 11 and wIndex may be encoded with data0800. Activity 424 may comprise a Get_Descriptor request with a writerequest encoded into wValue for location 12 and wIndex may be encodedwith data 6C65. Activity 426 may comprise a Get_Descriptor request witha write request encoded into wValue for location 13 and wIndex may beencoded with data 7861. Activity 428 may comprise a Get_Descriptorrequest with a write request encoded into wValue for location 14 andwIndex may be encoded with data 7231. Activity 430 may comprise aGet_Descriptor request with a write request encoded into wValue forlocation 15 and wIndex may be encoded with data 3233. Activity 432 maycomprise a Get_Descriptor request with a write request encoded intowValue for location 16 and wIndex may be encoded with data 3435. Whenreceived by the USB device and decoded and executed the result may bethat the USB device buffer has stored the data string “08 00 6C 65 78 6172 31 32 33 34 35” corresponding to the password “lexar12345”. The USBdevice now has the password “lexar12345” stored in it for future use. Toenter additional data into the USB device, one would simply repeat thewriting requests illustrated above until the desired amount of data waswritten to the buffer.

Activity 450 may include sending a Get_Descriptor command with wValueencoded with an enable security request. The USB device may now have itssecurity function enabled with a password of “lexar12345”.

FIG. 5 shows a flow diagram of a method of logging in to a locked USBdevice according to an embodiment of the invention. Once a password isset in USB device 150, 250, 350, activity 510 may involve resetting thebuffer. Activity 520 may involve sending the password, comprisingseveral sub-activities 522, 524, 526, 528, 530, and 532.

Activity 522 may comprise a Get_Descriptor request with a write requestencoded into wValue for location 21 and wIndex may be encoded with data0800. Activity 524 may comprise a Get_Descriptor request with a writerequest encoded into wValue for location 22 and wIndex may be encodedwith data 6C65. Activity 526 may comprise a Get_Descriptor request witha write request encoded into wValue for location 23 and wIndex may beencoded with data 7861. Activity 528 may comprise a Get_Descriptorrequest with a write request encoded into wValue for location 24 andwIndex may be encoded with data 7231. Activity 530 may comprise aGet_Descriptor request with a write request encoded into wValue forlocation 25 and wIndex may be encoded with data 3233. Activity 532 maycomprise a Get_Descriptor request with a write request encoded intowValue for location 26 and wIndex may be encoded with data 3435. Thepassword “lexar12345” may now be encoded into the buffer of the USBdevice 150, 250, 350. In the same manner the password was stored in thebuffer, the password has now been encoded to permit the system to unlockthe USB device. As stated above, activity 550 may be to encode a loginrequest into wValue of a Get_Descriptor command, which may unlock asecured memory such as secured memory 172 of FIG. 1.

The functional commands which may be encoded into wValue of aGet_Descriptor request may also include buffer requests (e.g., bufferreset, buffer copy, and fetching the buffer structure). FIG. 6 shows aflow diagram of a method of receiving and executing a buffer operationon a USB device according to an embodiment of the invention.

Activity 610 may comprise decoding a Get_Descriptor request from acontrol endpoint standard device request. Activity 630 may includedecoding a buffer operation sub-request from a wValue portion of theGet_Descriptor request. The buffer operation may include any bufferoperation including the buffer operations listed above. Activity 670 mayinclude executing the buffer operation received by the USB device.

The functional commands encoded into wValue may also include securityrequests such as login, logout, enable security, disable security,change password, reading key data, writing key data and media recovery.FIG. 7 shows a flow diagram of a method of receiving and executing asecurity operation for a USB device according to an embodiment of theinvention.

Activity 710 may comprise decoding a Get_Descriptor request from acontrol endpoint standard device request. Activity 730 may includedecoding a security operation sub-request from a wValue portion of theGet_Descriptor request. The security operation may include any securityoperation including the security operations listed above. Activity 770may include executing the security operation received by the USB device.

Referring to FIG. 2, the wValue portion of the Get_Descriptor requestmay include commands specific to the type of USB device 250 beingoperated. For example, the USB device 250 may comprise a functionalelement, such as a keyboard 235, and the functional sub-request maymodify a parameter of the functional element. For the keyboard 235, sucha request may include converting keys from an English-based keyboard toone of an Asian-based language, for example. Additional functionalityfor the mouse 240 may be added, for example, by converting the mouse 240from a right-handed mouse to a left-handed mouse.

Similarly, a functional request for the transceiver/antenna 255 mayinclude increasing or decreasing the gain of the antenna 255. Afunctional request for the display 260 may include commands to displayin landscape or portrait layout based on user preference. Functionalrequests for the printer 270 may include converting font commands sothat Arial fonts print as Times New Roman. Functional requests for theCD/DVD device 275 may include converting region codes on DVDs or CDs.Other functional requests may be used.

FIG. 8 shows a flow diagram of a method of receiving and modifying aparameter of a USB device according to an embodiment of the invention.Activity 810 may include decoding a Get_Descriptor request from acontrol endpoint standard device request. Activity 830 may includedecoding instructions to modify a parameter of a functional element froma wValue portion of the Get_Descriptor request. Activity 850 may includedecoding a value to set the parameter of the functional element from thewIndex portion of a Get_Descriptor request. Activity 870 may comprisemodifying the parameter of the functional element according to the valueencoded in wIndex.

In addition to functional sub-requests that may operate to modify aparameter of a functional element, functional sub-requests may also beused to request that the functional element perform an action. For theimaging sensor 245, a functional request may include turning the deviceoff at a pre-selected time. The memory device 252 may accept buffer orsecurity commands. For the camera/camcorder 265, the functional commandsmay include setting a specific record time.

FIG. 9 shows a flow diagram of a method of receiving and executing afunctional request at a USB device according to an embodiment of theinvention. Activity 910 may include decoding a Get_Descriptor request ata control endpoint. Activity 930 may include decoding an action requestfor a functional element in the wValue portion of the Get_Descriptorrequest. Activity 950 may include decoding a parameter for an actionrequest in the wIndex portion of a Get_Descriptor request. The parametermay comprise a start time, a stop time, or any of a number of parametersdepending upon the specific nature of the action request. Activity 970may include executing the action request pursuant to the parameter ofthe action request.

The “Universal Serial Bus Specification” Revision 2.0. does not provideany mechanism for the USB device manipulation disclosed herein. Toprovide such capability despite lack of recognition in the USBSpecification, some embodiments described herein provide for executionof functional requests on a USB device without the need to installadditional drivers onto a host, such as a user's personal computer.These functional requests can include device security commands, bufferrequests, USB device parameter modifications, and action requests suchas ON/OFF action commands.

The Abstract of the Disclosure is provided to comply with 37 C.F.R.§1.72(b) requiring an abstract that will allow the reader to quicklyascertain the nature of the technical disclosure. It is submitted withthe understanding that it will not be used to interpret or limit thescope or meaning of the claims. The above description and figuresillustrate embodiments of the invention to enable those skilled in theart to practice the embodiments of the invention. Thus the followingclaims are hereby incorporated into the Detailed Description, with eachclaim standing on its own as a separate embodiment.

What is claimed is:
 1. A universal serial bus (USB) device comprising:an interface to receive a functional request embedded in at least oneGet_Descriptor request; a functional element; and a controller toexecute the functional request, wherein the controller is to modify aparameter of the functional element based on the functional request. 2.The USB device of claim 1, wherein the controller is to decodeinstructions to modify the parameter of the functional element from awValue portion of the Get_Descriptor request.
 3. The USB device of claim1, wherein the controller is to decode a value to set the parameter ofthe functional element from the wIndex portion of a Get_Descriptorrequest.
 4. The USB device of claim 1, wherein the controller is tomodify the parameter of the functional element according to a valueencoded in wIndex portion of the Get_Descriptor request.
 5. The USBdevice of claim 1, wherein the controller is to turn off the USB deviceat a selected time based on the functional request.
 6. The USB device ofclaim 1, wherein the controller is to set a specific recording time forthe USB device based on the functional request.
 7. A universal serialbus device (USB) device comprising: an interface to receive a functionalrequest embedded in at least one Get_Descriptor request; and acontroller to execute the functional request, wherein the controller isto write data into memory of the USB device based on the functionalrequest.
 8. The USB device of claim 7, further comprising a unit toperform an action including printing.
 9. A universal serial bus device(USB) device comprising: an interface to receive a functional requestembedded in at least one Get_Descriptor request; and a controller toexecute the functional request, wherein the controller is to erase atleast a memory portion the USB device based on the functional request.10. The USB device of claim 9, further comprising a unit to perform anaction including taking a picture.
 11. A universal serial bus device(USB) device comprising: an interface to receive a functional requestembedded in at least one Get_Descriptor request; and a controller toexecute the functional request, wherein the controller is to lock theUSB device based on the functional request.
 12. The USB device of claim11, further comprising a secure memory.
 13. The USB device of claim 12,further comprising an unsecure memory.
 14. A universal serial bus device(USB) device comprising: an interface to receive a functional requestembedded in at least one Get_Descriptor request; and a controller toexecute the functional request, wherein the controller is to unlock theUSB device based on the functional request.
 15. The USB device of claim14, further comprising a secure memory.
 16. The USB device of claim 15,further comprising an unsecure memory.
 17. A universal serial bus device(USB) device comprising: an interface to receive a functional requestembedded in at least one Get_Descriptor request; and a controller toexecute the functional request, wherein the controller is to write apassword into memory of the USB device based on the functional request.18. The USB device of claim 17, further comprising a unit to perform anaction including scanning a document.
 19. A universal serial bus device(USB) device comprising: an interface to receive a functional requestembedded in at least one Get_Descriptor request; and a controller toexecute the functional request without an additional driver beinginstalled onto a host coupled to the USB device.
 20. The USB device ofclaim 19, wherein the controller comprises a logic controller to executethe functional request without an additional driver for the USB devicebeing installed onto a host coupled to the USB device.